package com.hsmw.common.base;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

@Getter
@Setter
@ApiModel(value = "分页对象")
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class BasePage<T> implements Serializable {

	@NotNull(message = "查询的页数不可以为空")
	@ApiModelProperty(value = "当前页数")
	Integer pageNo;
	@NotNull(message = "查询的条数不可以为空")
	@ApiModelProperty(value = "显示条数")
	Integer pageSize;

	@ApiModelProperty(value = "订单状态")
	String orderStatus;

	@ApiModelProperty(value = "查询参数")
	String queryParam;
	@ApiModelProperty(value = "订单需求ID")
	String requestId;

	@ApiModelProperty(value = "订单ID")
	String orderId;

	@ApiModelProperty(value = "搅拌站ID")
	String plantId;

	@ApiModelProperty(value = "项目ID")
	String itemId;

	@ApiModelProperty(value = "项目名称")
	String itemName;

	@ApiModelProperty(value = "散户或者工长ID")
	String userId;

	@ApiModelProperty(value = "工长位置")
	String currentLocate;

	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty(value = "起始时间")
	private LocalDateTime startTime;

	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty(value = "终止时间")
	private LocalDateTime endTime;


	@ApiModelProperty(value = "查询的项目名称 或者司机名称")
	String  itmeNameOrDriverName;

	@ApiModelProperty(value = "查询的 施工单位的名称的集合")
	List<String> constructionUnitNames;


	@ApiModelProperty(value = "封装的需要查询的字段")
	T requestData;
}
